home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / asmutil / ps85a12.zip / A85.DOC < prev    next >
Text File  |  1987-03-15  |  37KB  |  1,083 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.                              PseudoSam 85 Assembler Manual V1.2.02
  12.                              Copyright(c) 1986,87 PseudoCode
  13.  
  14.  
  15.  
  16.  
  17.  
  18. Disclaimer:
  19.  
  20.             PseudoSam 85 is distributed as is, with no guarantee that it
  21.             will work correctly in all situations.  In no event will the
  22.             Author be liable for any damages, including lost profits,
  23.             lost savings or other incidental or consequential damages
  24.             arising out of the use of or inability to use these
  25.             programs, even if the Author has been advised of the
  26.             possibility of such damages, or for any claim by any other
  27.             party.
  28.  
  29.             It is the users reponsibility to back up all important files!
  30.  
  31.             See copyright information in appendix B
  32.  
  33.  
  34.  
  35.  
  36.  
  37.                          Table of Contents
  38.  
  39. Chapter 1  PseudoSam 85 assembler vs. the Intel assembler.
  40.  
  41. Chapter 2  Running the assembler program.
  42.  
  43. Chapter 3  Assembler statement syntax
  44.  
  45. Chapter 4  Data types
  46.  
  47. Chapter 5  Expressions
  48.  
  49. Chapter 6  Assembler Directives
  50.   (also known as assembler Pseudo-opcodes)
  51.  
  52. Appendix A      ASCII character set
  53.  
  54. Appendix B      Copyright and registration information
  55.  
  56. Appendix C      Description of Files
  57.  
  58. Appendix D      Bug Reporting Procedure(Registered users ONLY!).
  59.  
  60.  
  61.  
  62.  
  63. Chapter 1 PseudoSam 85 assembler vs. the Intel assembler
  64.  
  65.      All PseudoSam(Pseudo brand Symbolic AsseMbler) assemblers conform to
  66.      a common syntax based on the UNIX system V assembler syntax. By
  67.      conforming to this Pseudo standard, conflicts with the manufacturers
  68.      syntax are created.  Below is a brief and incomplete list of those
  69.      conflicts.
  70.  
  71.       Intel format                     PseudoSam format
  72.  
  73. <identifier> equ <expression>         .equ <identifier> , <expression>
  74.  
  75. <identifier> set <expression>         .set <identifier> , <expression>
  76.  
  77. Has Macro capability                  No Macro capability at this time
  78.  
  79.  
  80.  
  81. * The difference in name between the Intel and the PseudoSam name
  82.   of assembler directives can be circumvented by the .opdef directive.
  83.  
  84.   example
  85.  
  86.    .opdef  eject,.eject      ;defines eject to be synonymous with .eject
  87.  
  88. *  A file syn.asm is distributed with the assembler with some useful
  89.    redefinitions.
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100. Unix system V is a trademark of AT & T.
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108. Chapter 2  Running the assembler program
  109.  
  110. 1.  Command line switch setting and source file specification.
  111.  
  112.      Assuming the user has an assembly language source file called foo.asm
  113.      type the following command:
  114.  
  115. a85 foo
  116.  
  117.      The assembler will assemble the program foo.asm using the default
  118.      assembler switch settings. the following files will be generated
  119.      by the assembler:
  120.  
  121.      foo.lst   ;assembled listing shown the code conversion and
  122.                ; any errors that where discover by the assembler.
  123.  
  124.      foo.obj   ;assembled object code in Intel Hex format.
  125.  
  126. **  for a list of switch setting see the .command assembler directive
  127.     description in chapter 6.
  128.  
  129. *** The assembler uses the following temporary file names.
  130.  
  131.     z0z0z0z0.tmp
  132.     z1z1z1z1.tmp
  133.  
  134.     ANY files with these names will be DESTROYED by the
  135.     by the assembler.
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143. Chapter 3  Assembler statement syntax
  144.  
  145. 1. Assembler Statements
  146.  
  147.      Assembler statements contain from zero to 4 fields as shown in
  148.      following.
  149.  
  150. <label> <opcode> <expressions> <comment>
  151.  
  152.      All fields are optional, but they must be in this order.
  153.  
  154. A.   Labels (<label>) are symbolic names that are assigned the starting
  155.      address of any code generated by the opcode and or expressions
  156.      of this line.(see section 2).
  157.  
  158. B.   Operation codes(<opcode>) tell the assembler what machine instruction
  159.      to generate, or what assembler control function to perform.
  160.      The operation code also tells the assembler what expressions are
  161.      required to complete the machine instruction or assembler directive.
  162.      (see chapter 6).
  163.  
  164. C.   Expression requirements are set by the opcode(see the microprocessor
  165.      reference manual or the assembler directives chapter for individual
  166.      opcode requirements).(see chapter 5).
  167.  
  168. D.   Comments are notes written by the programmer to explain what the
  169.      program is trying to accomplish. Comments generate no code.
  170.      (see section 3).
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178. 2.  Labels
  179.  
  180.      Labels can be unlimited in length, but only the first eight characters
  181.      are used to distinguish between them.  They must conform to the
  182.      following syntax.
  183.  
  184.      <label>  -> <identifier>':'
  185.  
  186.      <identifier> -> <alphabetic character> <identifier character string>
  187.  
  188.      <alphabetic character> -> character in the set ['A'..'Z', 'a'..'z', '.']
  189.  
  190.      <identifier character string> -> any sequence of characters from the
  191.                                       set ['A'..'Z','a'..'z', '.', '0'..'9']
  192.  
  193. example
  194. abc:                  ;label referred to as abc
  195. a c:                  ;not a valid label
  196.          foo:         ;label referred to as foo
  197. .123:                 ;label referred to as .123
  198.  
  199. * Case makes NO difference!
  200.  
  201. d:      ;is the same as
  202. D:
  203.  
  204.  
  205. 3.  Comments
  206.      Comments must start with a semi-colon ; and are terminated
  207.      by an end of line or file( <lf>(^J) or <sub>(^Z) ). An end
  208.      of line is inserted by typing the enter or return key by
  209.      most text editors.
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217. Chapter 4     Data types
  218.  
  219. 1.  Integers
  220.  
  221.     Integer constants can be specified in any of the following forms:
  222.  
  223. A.  Binary
  224.  
  225.     b'bb             ;bb=string of binary digits
  226.     B'bb
  227.  
  228. B.  Decimal
  229.  
  230.     ndd
  231.     d'dd             ;n=nozero decimal digit
  232.     D'dd             ;dd=string of decimal digits
  233.  
  234. C.  Octal
  235.  
  236.     0qq              ;qq=string of octal digits
  237.     o'qq
  238.     O'qq
  239.     q'qq
  240.     Q'qq
  241.  
  242. D.  Hexidecimal
  243.  
  244.     0x'hh            ;hh=string of hexidecimal digits
  245.     0X'hh
  246.     h'hh
  247.     H'hh
  248.     x'hh
  249.     X'hh
  250.  
  251.  
  252. Examples:
  253.  
  254.     077        ;octal number 77 = decimal 63
  255.     b'0101     ;binary number 101 = decimal 5
  256.     77         ;decimal number 77 = octal 115
  257.     h'ff       ;hexidecimal ff = decimal 255
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264. 2.  Strings:
  265.  
  266.     Strings consist of a beginning quote " followed by any reasonable number
  267.     of characters followed by an ending quote ". Control characters and double
  268.     quotes " and backslash \ may not be used in strings directly.  These
  269.     special characters are included by using a special escape sequence which
  270.     the assembler translates into the appropriate ASCII code.
  271.  
  272. Note: Strings may not be used in expressions!
  273.       Although character constants may(see below).
  274.  
  275. Escape sequences
  276.   "\"" string containing "
  277.   "\\" string containing \
  278.   "\'" string containing '
  279.   "\0" string containing null
  280.   "\n" string containing linefeed
  281.   "\r" string containing carriage return
  282.   "\f" string containing formfeed
  283.   "\t" string containing horizontal tab
  284.   "\nnn" string containing the ASCII character who's code is o'nnn
  285.          (nnn are octal digits).
  286.   * see appendix A for ASCII codes.
  287.  
  288. 3.  Character Constants:
  289.  
  290.     Character constants consist of  a single quote ' followed by
  291.     a character or an escape sequence(see above) followed by a
  292.     single quote '.
  293.  
  294. example:
  295.    'A' = ASCII character value for the letter A = 65 (decimal);
  296.    '\''= ASCII character value for the character ' = 39 (decimal).
  297.  
  298. Character constants are treated as integers by the assembler and
  299. are valid where ever an integer value is valid.
  300.  
  301. example:
  302.    'A' + 1 = 66
  303.  
  304.   * see appendix A for ASCII codes.
  305.  
  306. 4.  Symbolic values
  307.  
  308.     Symbolic values are generally labels, but may be any identifier
  309.     assigned an integer value(using .set or .equ pseudo-ops).
  310.  
  311.     As a special case the symbol * when used as an operand in an
  312.     expression denotes the value of the location counter (the value
  313.     the program counter will have during operation) at the beginning
  314.     of the current line.
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321. Chapter 5  Expressions
  322.  
  323.      All expressions evaluate to integer values modulo 65536(2^16) and are
  324.      w